
<!DOCTYPE html>
<!--[if lt IE 7 ]>
<html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>
<html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>
<html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]>
<html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html lang="en" class="no-js"><!--<![endif]-->
<head>
    <title> 抽奖系统 </title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="X-UA-Compatible" content="IE=7">
    <!-- iphone safari -->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
    <meta content="telephone=no" name="format-detection"/>
    <meta name="Author" contect="Mr.He"/>
    <link rel="apple-touch-icon" size="72x72" href="images/icon.png"/>
    <link rel="stylesheet" type="text/css" href="css/common.css">

    <style>
        body {
            margin: 0;
            padding: 0;
        }

        #enterDiv input {
            height: 20px;
            width: 200px;;
        }
    </style>
    <script src="js/jquery-1.7.2.min.js"></script>
    <script src="js/jqm-1.1.1.min.js"></script>
    <script type="text/javascript">
        var nums = ["15236524512", "18602992689", "15249213127", "15210136035", "18291803027", "18829343950", "18682950947", "18829011866", "18629893980", "13701926991", "13720435870", "18292815282", "15639791566", "15991611019", "18829343496", "13891836486", "13583351707", "18428309695", "18392185492", "15812809396", "18891998891", "13629037419", "13720438003", "15209249593", "18392394278", "18848982103", "15249229149", "13991279501", "15909165069", "15802961380", "18392093750"];
        var result = null;
        window.localStorage.setItem("numsIndex_g", 1);
        $(document).ready(function (e) {
            initnums();
            $(".backIndex").live("click", function () {
                window.location.href = "index.html";
            });
            $(".title").live("taphold", function () {
                $("#enterDiv").show();
            });
            $("#okbtn").live("click", function () {
                for(var i=1;i<=3;i++){
                    window.localStorage.setItem("num_g"+i,$("#g_number"+i).val());
                }
                $("#enterDiv").hide();
            });
            $("#refreshbtn").live("click", function () {
                initnums();
            });
            $("#cancelbtn").live("click", function () {
                $("#enterDiv").hide();
            });
            $(".wrap").css({"position": "relative", "top": "75%"});
            resize();
            $(".page img").live("click", function () {
                $(".numtitle").text("");
                if ($(this).attr("alt") == "off") {
                    drawstart();
                    $(this).attr({"alt": "on", "src": "images/stop.png"});
                } else {
                    stop();
                    $(this).attr({"alt": "off", "src": "images/start.png"});
                    var curIndex = localStorage.getItem("numsIndex_g") * 1;
                    $(".numtitle").text("第" + curIndex + "位幸运观众");
                    try{
                        shownum(localStorage.getItem("num_g"+curIndex));
                     }catch (e){

                    }finally{
                        curIndex++;
                        localStorage.setItem("numsIndex_g", curIndex);
                    }

                }
            });
            $(".title").live("click", function () {
                location.href = 'choujiang_z.html';
            });
        });
        function drawstart() {
            var l = nums.length;
            r = setInterval(function () {
                var randomIndex = Math.floor(Math.random() * l);
                shownum(nums[randomIndex]);
            }, 50);
        }
        function stop() {
            clearInterval(r);
        }
        function shownum(n) {
            n = n.substr(0, 3) +
                    '<img src="images/xing.png" width="60">' +
                    '<img src="images/xing.png" width="60">' +
                    '<img src="images/xing.png" width="60">' +
                    '<img src="images/xing.png" width="60">' +
                    n.substr(7, 10);
            $(".numshow").html(n);
        }
        function resize() {
            var wH = $(window).height();
            $(".page").css({"height": wH + "px", "background-size": "100% " + wH + "px"});
        }
        window.onresize = resize;
        addEventListener("load", function hideURLbar() {
            window.scrollTo(0, 1);
        }, false);

        function initnums(){
            try{
                $.getJSON("http://vote2014z.xayoudao.com/index.php?r=Dsgd/get_award",function(result){
                    var datas=result.data,i=1;
                    $.each(datas,function(index,result){
                        $("#g_number"+(index+1)).val(datas[index]);
                    });
                });

                var nd=new Date();
                $("#nowdate").text(nd.getFullYear()+"年"+(nd.getMonth()+1)+"月"+nd.getDate()+"日"+nd.getHours()+":"+nd.getMinutes()+":"+nd.getMilliseconds());

            }catch (e){
                alert("网络问题,"+ e.message);
            }

        }
    </script>
    <style type="text/css">
        .page {
            padding: 0;
            background: url("images/backdraw.jpg") no-repeat;
            text-align: center
        }

        .wrap {
            width: 100%;
            height: 100px;
        }

        .wrap img {
            width: 40%;
        }
    </style>
</head>

<body>
<div id="enterDiv" style="display: none;">
    <div style="position: absolute;opacity: 0.5; background-color:#000;top: 0px;left: 0px;height: 100%;width: 100%;z-index: 888;"></div>
    <div style="position: absolute;background-color:#106DAC;top: 50px;left: 20%;padding-bottom: 50px;width: 60%;z-index: 999; color: #ffffff; font-size: 22px; border: 1px #fff solid;text-align: center">
        <br><br>
        高校组
        <br>
        <input type="number" class="inputnum_g" value="13911111111" id="g_number1"><br> <br>
        <input type="number" class="inputnum_g" value="13922222222" id="g_number2"><br> <br>
        <input type="number" class="inputnum_g" value="13933333333" id="g_number3"><br> <br>
        <span id="nowdate"></span>
        <br><br><br><br>
        <div style="width: 100%;height: 30px;text-align: center;">
            <a id="okbtn" href="javascript:void(0)" style="text-decoration: underline; color: #ffffff">确定</a>&nbsp;&nbsp;&nbsp;
            <a id="cancelbtn" href="javascript:void(0)" style="text-decoration: underline; color: #ffffff">取消</a>&nbsp;&nbsp;&nbsp;
            <a id="refreshbtn" href="javascript:void(0)" style="text-decoration: underline; color: #ffffff">刷新</a>
        </div>
    </div>
</div>
<button class="backIndex"></button>
<button data-role="none" class="title">高校组抽奖</button>
<div class="numtitle"></div>
<div class="numshow">
</div>
<div class="page">
    <div class="wrap">
        <img src="images/start.png" alt="off"/>
    </div>
</div>
</body>
</html>

